Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add a method to check if the scope module already exists in the capability keeper #6716

Merged
merged 7 commits into from
Jul 1, 2024

Conversation

Pantani
Copy link
Contributor

@Pantani Pantani commented Jun 27, 2024

Description

Add method HasModule(moduleName string) to check if the scope module already exists in the capability keeper. This method can help avoid creating two scope keepers by mistake and panicking the chain, and it helps the workaround to make IBC work with the app wiring chains.

Copy link
Contributor

@DimitrisJim DimitrisJim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like a sensible addition to me!

@damiannolan
Copy link
Member

This method can help avoid creating two scope keepers by mistake and panicking the chain

Do you have a use case for not sealing the capability keeper and using ScopeToModule at runtime to create new scopedKeepers? Or do you mean to just panicking the chain at start up, within the instantiation of the app?

Either way, happy to merge this addition. We should be able to make a patch release of x/capability to include it!

Copy link
Member

@damiannolan damiannolan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Pantani! 🙏🏻

modules/capability/keeper/keeper_test.go Outdated Show resolved Hide resolved
@damiannolan damiannolan enabled auto-merge July 1, 2024 12:58
@damiannolan damiannolan added this pull request to the merge queue Jul 1, 2024
Merged via the queue into cosmos:main with commit 8942179 Jul 1, 2024
83 of 88 checks passed
mergify bot pushed a commit that referenced this pull request Jul 1, 2024
… capability keeper (#6716)

* add method to check if the scope module already exist

* chore: add changelog

* Update modules/capability/keeper/keeper_test.go

Co-authored-by: Nikolas De Giorgis <[email protected]>

---------

Co-authored-by: DimitrisJim <[email protected]>
Co-authored-by: Damian Nolan <[email protected]>
Co-authored-by: Nikolas De Giorgis <[email protected]>
(cherry picked from commit 8942179)

# Conflicts:
#	modules/capability/CHANGELOG.md
damiannolan added a commit that referenced this pull request Jul 1, 2024
… capability keeper (backport #6716) (#6732)

* feat: add a method to check if the scope module already exists in the capability keeper (#6716)

* add method to check if the scope module already exist

* chore: add changelog

* Update modules/capability/keeper/keeper_test.go

Co-authored-by: Nikolas De Giorgis <[email protected]>

---------

Co-authored-by: DimitrisJim <[email protected]>
Co-authored-by: Damian Nolan <[email protected]>
Co-authored-by: Nikolas De Giorgis <[email protected]>
(cherry picked from commit 8942179)

# Conflicts:
#	modules/capability/CHANGELOG.md

* chore: fix conflicts

* chore: update changelog

---------

Co-authored-by: Danilo Pantani <[email protected]>
Co-authored-by: DimitrisJim <[email protected]>
Co-authored-by: Damian Nolan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants